import { request } from '../utils/index.js';
export default {
    setToken: (token) => (localStorage["u-t"] = token),
    getToken: () => localStorage["u-t"],
    adminLogin: ({ adminName, adminPassword }) => request({
        type: "get",
        url: "/api/login",
        data: { adminName, adminPassword }
    }),
    adminReg: ({ username, password }) => request({
        type: "post",
        url: "/api/reg",
        data: { username, password }
    }),
    checkName: ({ adminName }) => request({
        type: "get",
        url: "/api/checkName",
        data: { adminName }
    }),
    getList: ({ curPage = 1, eachPage = 5 }) => request({
        type: "get",
        url: "/api/getList",
        data: { curPage, eachPage }
    }),
    deleteAdmin: ({ _id }) => request({
        type: "delete",
        url: "/api/deleteAdmin",
        data: { _id }
    }),
    checkPwd: (data) => request({
        type: "post",
        url: "/api/checkPwd",
        data: data
    }),
    updatePwd: data => request({
        type: "patch",
        url: "/api/updatePwd",
        data: data
    }),
}